<?php

namespace app\api\validate;

use think\Validate;

class MerchantCar extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
	    'id' => 'require',
        'car_id' => 'require',
        'merchant_car_name' => 'require',
	    'banner' => 'require',
	    'car_price' => 'require',
	    'car_deposit' => 'require',
	    'car_note' => 'require',
	    'car_number' => 'require',
	    'registration_time' => 'require',
	    'driving_license' => 'require',
	    'check_image' => 'require',
	    'car_label' => 'require',
	    'handle_fee' => 'require',
	    'night_pick_fee' => 'require',
	    'night_return_fee' => 'require',
	    'car_insurance' => 'require',
        'insure_file' => 'require'
    ];
    /**
     * 提示消息
     */
    protected $message = [
	    'id.require' => '商家车辆id不得为空',
        'car_id.require' => '请选择平台车辆',
        'merchant_car_name.require' => '商家车辆名称不能为空',
	    'banner.require' => '请上传轮播图',
	    'car_price.require' => '日均价格不能为空',
	    'car_deposit.require' => '租车押金不能为空',
	    'car_note.require' => '车辆详情不能为空',
	    'car_number.require' => '车牌号不能为空',
	    'registration_time.require' => '车辆注册时间不能为空',
	    'driving_license.require' => '行驶证不能为空',
	    'check_image.require' => '检车图片不能为空',
	    'car_label.require' => '车辆标签不能为空',
	    'handle_fee.require' => '手续费不能为空',
	    'night_pick_fee.require' => '夜间取车服务费不能为空',
	    'night_return_fee.require' => '夜间还车服务费不能为空',
	    'car_insurance.require' => '车辆保险不能为空',
	    'insure_file.require' => '保险文件不能为空',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['car_id','car_price','car_number','registration_time','driving_license','check_image','handle_fee','night_pick_fee','night_return_fee','car_insurance', 'insure_file'],
        'edit' => ['id','car_id','car_price','car_number','registration_time','driving_license','check_image','handle_fee','night_pick_fee','night_return_fee','car_insurance', 'insure_file'],
        'price' => ['id','car_price','handle_fee','night_pick_fee','night_return_fee'],
    ];
    
}
